#ifndef _EMU_MACHINE_H_
#define _EMU_MACHINE_H_

/*******************************************************************
  THIS SOURCE IS BASED ON SNES4ALL CHUS'S WORK
  SEE http://chui.dcemu.co.uk/snes4all.html
*******************************************************************/


#define bzero(A,B) memset(A,0,B)

#ifdef __SYMBIAN32__
#define DATA_PREFIX ".\\data\\"
//#define AUTOLOAD "e:\\data\\demo.smc"
#else
#define DATA_PREFIX "e:/data/"
//#define AUTOLOAD "vSun\SMRPG_US.smc"
#endif

extern int   emu_frameskip;
extern int   emu_transparency;
extern int   emu_throttle;
extern char   emu_image_file[];
extern int   emu_emulating;
extern unsigned   emu_timeslice;
extern int   emu_sound_throttle;

extern unsigned   emu_max_vcounter;
extern long   emu_vcounter[];

extern unsigned   emu_apu_hmax;

#ifdef NORES256
#define EMU_SCREEN_WIDTH 320
#define EMU_SCREEN_HEIGHT 240
#define EMU_SCREEN_PAD (EMU_SCREEN_WIDTH - 256)/2
#else
#define EMU_SCREEN_WIDTH 256
#define EMU_SCREEN_HEIGHT 240
#define EMU_SCREEN_PAD (EMU_SCREEN_WIDTH - 256)/2
#endif
#define EMU_SCREEN_WIDTH_BUFFER 512
#define EMU_SCREEN_HEIGHT_BUFFER 478
#define EMU_SCREEN_DEPTH_BYTES 2
#define EMU_SCREEN_DEPTH (8 * EMU_SCREEN_DEPTH_BYTES)
#define EMU_SCREEN_PITCH (EMU_SCREEN_WIDTH_BUFFER * EMU_SCREEN_DEPTH_BYTES)
#define EMU_SCREEN_PITCH_LO (EMU_SCREEN_WIDTH * EMU_SCREEN_DEPTH_BYTES)
#define EMU_SCREEN_PITCH2 (EMU_SCREEN_PITCH >> 1)

#ifdef NORES256
#define getY(Y) (EMU_SCREEN_WIDTH * EMU_SCREEN_DEPTH_BYTES * (Y) )
#define getY2(Y) (((EMU_SCREEN_WIDTH * EMU_SCREEN_DEPTH_BYTES)>>1) * (Y) )
#else
#define getY(Y) ( (Y) << 9 )
#define getY2(Y) ( (Y) << 8 )
#endif

#endif
